package upicgame.cart.dao.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Repository;

import upicgame.cart.dao.RedisCartDao;
@Repository
public class RedisCartDaoImpl implements RedisCartDao{
	@Autowired
	private RedisTemplate<String, Object> rt;

	// redis
	@Override
	public void saveRedisCart(String id, String json) {
		System.out.println(json);
		rt.opsForValue().set(id, json); 
	}
	@Override
	public String getRedisCart(String id) {
		String json = (String) rt.opsForValue().get(id);
		System.out.println(json);
		return json;
	}
	
}
